package com.yuedao.sender.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.yuedao.sender.stomp.controller.BaseInfoPassengerController;
import com.yuedao.sender.stomp.controller.OperateArriveController;
import com.yuedao.sender.stomp.controller.OperateDepartController;
import com.yuedao.sender.stomp.controller.OperateLoginController;
import com.yuedao.sender.stomp.controller.OperateLogoutController;
import com.yuedao.sender.stomp.controller.OperatePayController;
import com.yuedao.sender.stomp.controller.OrderCancelController;
import com.yuedao.sender.stomp.controller.OrderCreateController;
import com.yuedao.sender.stomp.controller.OrderMatchController;
import com.yuedao.sender.stomp.controller.PositionDriverController;
import com.yuedao.sender.stomp.controller.PositionVehicleController;
import com.yuedao.sender.stomp.map.LinkMap;

@Controller
@RequestMapping("/stomp")
public class PageTransferController {
	@Autowired
	OperateLoginController ol;
	
	@Autowired
	BaseInfoPassengerController b;
	
	@Autowired
	OperateArriveController ovc;
	
	@Autowired
	OperateDepartController odc; 
	
	@Autowired
	OperateLogoutController oloc;
	
	@Autowired
	OperatePayController  opc;
	
	@Autowired
	OrderCancelController occ;
	
	@Autowired
	OrderCreateController occl;

	@Autowired
	OrderMatchController omc;
	
	@Autowired
	PositionDriverController pdc;
	
	@Autowired
	PositionVehicleController pvc;
	
	@RequestMapping(value="/addLink")
	public String toIndex(){
		System.out.println("开始订阅队列信息！");
		ol.getOperateLogin();
		
		oloc.getOperateLogout();
		
		b.getPassengerInfo();
	
	
		
		ovc.getOperateArrive();
		
		odc.getOperateDepart();
		
		opc.getOperatePay();
		
		occ.getOrderCancel();
		
		occl.getOrderCreate();
		
		omc.getOrderMatch();
		
		pdc.getPositionDriver();
	
		pvc.getPositionVehicle();
		
		
		System.out.println("订阅队列信息完成！");
		/*BaseInfoPassengerController b= new BaseInfoPassengerController();
		 * b.getPassengerInfo();
		OperateArriveController ovc = new OperateArriveController();
			ol.getOperateLogin();
		OperateDepartController odc = new OperateDepartController();
		odc.getOperateDepart();
		
		OperateLoginController ol = new OperateLoginController();
		ol.getOperateLogin();
		
		OperateLogoutController oloc = new OperateLogoutController();
		oloc.getOperateLogout();
		
		OperatePayController  opc = new OperatePayController();
		opc.getOperatePay();
		
		OrderCancelController occ = new OrderCancelController();
		occ.getOrderCancel();
		
		OrderCreateController occl = new OrderCreateController();
		occl.getOrderCreate();
		
		OrderMatchController omc = new OrderMatchController();
		omc.getOrderMatch();
		
		PositionDriverController pdc = new PositionDriverController();
		pdc.getPositionDriver();
		
		PositionVehicleController pvc = new PositionVehicleController();
		pvc.getPositionVehicle();*/
		
		return "index";
		
	}
	
	
	@RequestMapping(value="/stopStompLink")
	public String stompLink(){
		System.out.println("开始stop连接！");
		try {
			LinkMap.removeAllStompLink();	
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "";
	}
	
	
}
